#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	int n;scanf("%d",&n);
	std::vector<int> v(n);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d",&v[i]);
	}

	int ans=-1;
	std::vector<int> :: iterator i;
	for (i = v.begin()+1; i != v.end(); ++i)
	{
		int tmp=abs(*i-*(i-1));
		if(tmp>ans){
			ans=tmp;
		}
	}
	printf("%d\n", ans);

	return 0;
}